package com.ruide.dao;

import java.util.List;

import com.ruide.db.DBManager;
import com.ruide.mapper.BTReportMapper;
import com.ruide.mapper.bankUsersMapper;
import com.ruide.vo.BTReport;
import com.ruide.vo.bankUsers;

public class BTReportDAO {
	public int save(BTReport b){
		String sql="insert into BTReport values(?,?,?,?,?)";
		Object params[]={b.getCount(),b.getUserid(),b.getUseridto(),b.getMoney(),b.getTime()};
		DBManager db=new DBManager();
		int i=db.executeUpdate(sql, params);
		return i;
	}

	public List<BTReport> findAll(){
		String sql="select * from BTReport order by count";
		Object params[]=null;
		DBManager db=new DBManager();
		BTReportMapper mapper=new BTReportMapper();
		List<BTReport> list=db.executeQuery(sql, mapper, params);
		return list;
	}
	public List<BTReport> findById(int userid){
		String sql="select * from BTReport where userid=? order by userid";
		Object params[]={userid};
		DBManager db=new DBManager();
		BTReportMapper mapper=new BTReportMapper();
		List<BTReport> list=db.executeQuery(sql, mapper, params);
		return list;
	}
	
}
